﻿using mozhi.smarterp.Finance.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace mozhi.smarterp.Finance.AccountsPayables.PurchasePayables
{
    public class PurchasePayableCreateDto
    {
        [Required]
        public DateTime Date { get; set; }

        public DateTime DueDate { get; set; }

        [Required]
        public Guid SupplierId { get; set; }

        [Required]
        public PayableDocumentType Type { get; set; }

        [Required]
        public RecognitionModelType RecognitionModel { get; set; }

        [Required]
        public Guid CurrencyId { get; set; }

        public decimal ExchangeRate { get; set; }

        public Guid? PurchaserDepartmentId { get; set; }

        public Guid? PurchaserId { get; set; }

        public Guid? PaymentTermId {  get; set; }

        public bool IsCreditNote {  get; set; }

        public string Comment {  get; set; }

        /// <summary>
        /// 源单Id
        /// </summary>
        public Guid? SourceId { get; set; }

        public List<PurchasePayableItemCreateDto> Items { get; set; }
    }

    public class PurchasePayableItemCreateDto 
    {
        public Guid? ProductId { get; set; }

        public Guid? ExpenseItemId { get; set; }

        /// <summary>
        /// 计价数量
        /// </summary>
        public decimal BasicQuantity { get; set; }

        public decimal Price { get; set; }

        public Guid? TaxRateId { get; set; }

        public decimal? AmountFr { get; set; }

        /// <summary>
        /// 是否计入采购成本
        /// </summary>
        public bool? IsRecordedCost { get; set; }

        /// <summary>
        /// 费用承担部门
        /// </summary>
        public Guid? ExpenseBurdenDepartmentId { get; set; }

        public string Remark {  get; set; }

        /// <summary>
        /// 源单明细Id
        /// </summary>
        public Guid? SourceItemId { get; set; }
    }
}
